Re: [fltk.general] Fl | 您所在的位置:网站首页 › fltk 138 fl › Re: [fltk.general] Fl |
You probably just need to change the cursor position to 0 after pre-setting the field's value, and after the user finishes entering a value (when they hit ENTER or when they navigate off the field). The docs say Fl_Input_::position(int p) is how to set the cursor position, so try setting that to 0 after changing the value(), and ditto for the callback, assuming you set when() to a value appropriate for your widget so the callback is invoked at the right times. You can also preselect the text, so if someone navigates to the field and starts typing a new value, since it's preselected, typing the first character replaces the old value (instead of inserting). The user has the option to deselect first. |
CopyRight 2018-2019 实验室设备网 版权所有 |